/********************************************************************
	Copyright (c) 2010-2020 by TnmuJoy
	@created:	10-10-2011   22:32
	@filename: 	FactoryDemo.h
	@author:	limiko lau(limiko.lau@gmail.com)
	@desc:		
*********************************************************************/
#ifndef DEMO_FACTORYDEMO_H_
#define DEMO_FACTORYDEMO_H_

#include "DesignPattern/Factory.hxx"

class ProductDemoA
{
public:
    virtual void test() = 0;
};

class ProductDemoA1 : public ProductDemoA
{
public:
    virtual void test()
    {
        std::cout<<"ProductDemoA1::test()\n";
    }
};

class ProductDemoA2 : public ProductDemoA
{
public:
    virtual void test()
    {
        std::cout<<"ProductDemoA2::test()\n";
    }
};

class FactoryDemoA : public tnmujoy::gdut::Factory<ProductDemoA>
{
public:
protected:
private:
};





class ProductDemoB
{
public:
    virtual void test() = 0;
};

class ProductDemoB1 : public ProductDemoB
{
public:
    virtual void test()
    {
        std::cout<<"ProductDemoB1::test()\n";
    }
};
REGISTER_PRODUCT_CLASS(ProductDemoB, ProductDemoB1);

class ProductDemoB2 : public ProductDemoB
{
public:
    virtual void test()
    {
        std::cout<<"ProductDemoB2::test()\n";
    }
};
REGISTER_PRODUCT_CLASS(ProductDemoB, ProductDemoB2);

class FactoryDemoB : public tnmujoy::gdut::Factory<ProductDemoB>
{
public:
protected:
private:
};


class ProductDemoC
{
public:
    virtual void test() = 0;
};

class ProductDemoC1 : public ProductDemoC
{
public:
    virtual void test()
    {
        std::cout<<"ProductDemoC1::test()\n";
    }
};
REGISTER_ALIAS_PRODUCT_CLASS(ProductDemoC, ProductDemoC1, "C1");

class ProductDemoC2 : public ProductDemoC
{
public:
    virtual void test()
    {
        std::cout<<"ProductDemoC2::test()\n";
    }
};
REGISTER_ALIAS_PRODUCT_CLASS(ProductDemoC, ProductDemoC2, "C2");

class FactoryDemoC : public tnmujoy::gdut::Factory<ProductDemoC>
{
public:
protected:
private:
};

#endif //DEMO_FACTORYDEMO_H_